package com.webcamtracker.tracker.example.portal;

import com.webcamtracker.move.tracking.AplicationListener;
import com.webcamtracker.move.tracking.TrackingEventDispacher;
import com.webcamtracker.move.tracking.TrackingEventType;

import javax.swing.*;
import java.awt.*;


public class PortalFrame extends JFrame implements AplicationListener {

    private PortalPanel portalPanel;

    public PortalFrame() {
        super("Portal Frame!");
        start();
    }

    public void start() {

        portalPanel = new PortalPanel(new Dimension(320, 240));

//        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setContentPane(portalPanel);
        pack();
       // setLocationRelativeTo(null);
        setVisible(true);
    }

    public static void main(String[] args) {
        new PortalFrame();
    }

    public void subscribeToTracking(TrackingEventDispacher dispacher, String elementId) {
        dispacher.addTrackingEventListener(portalPanel, TrackingEventType.ALL);

    }
}
